package openbang.common.vo;

/**
 * 
 * 系统支持的页面组件的类型定义 : 
 * 
 * @author aibo zeng
 *
 */

public enum WidgetTypeEnum {
	SingleTable(100,"单表格"),
	MasterSecondTable(101,"主从表格"),         //Master  secondary
	MasterMultiSecondTable(102,"一主多从表格"),
	QueryTableOnly(200,"只读查询表格"),
	QueryTableDele(201,"查询表格可删除"),
	QueryTableDeleModi(202,"查询表格可删改"),
	QueryTreeTable(300,"查询树表格"),
	CUSTOM(9999,"用户自定义");


	private Integer code;
	private String desc;
	
	private WidgetTypeEnum(Integer code,String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public String getDesc(){
		return desc;
	}
	
	public static String getDesc(Integer code) {
		for(WidgetTypeEnum each : WidgetTypeEnum.values()) {
			if(each.getCode()==code)
				return each.getDesc();
		}		
		return "";
	}
}
